package util {
	/**
	 * @author Administrator
	 */
	public class NumberFormat {
		public static function getWan(value:int):String{
			if(value<10000){
				return String(value);
			}else{
				var n:int=value/10000;
				return String(n)+"万";
			}
		}
		public static function formatTime(time:Number, join:String = ":"):String {
			if(time<0){
				time=0;
			}
			var secondTime:Number=Math.round(time/1000);
            var h:int, m:int, s:int;
            var hstr:String, mstr:String, sstr:String;
            if (secondTime >= 3600) {
                h=Math.floor(secondTime/3600);
                secondTime=secondTime%3600;
                if (h<10) {
                        hstr = "0" + h + join;
                } else {
                        hstr = h + join;
                }
            }else {
                    hstr = "";
            }
            m = Math.floor(secondTime / 60);
            if (m < 10) {
                    mstr = "0" + m;
            }else {
                    mstr = m.toString();
            }
            s = Math.floor(secondTime % 60);
            if (s<10) {
                    sstr = "0" + s;
            }else {
                    sstr = s.toString();
            }
            return hstr + mstr + join + sstr;
        }
	}
}
